
/**
 * Test library functionality as we go.
 */

#include <swarm.h>
#include <stdio.h>
#include <math.h>

sw_xmm_vec v1;
sw_xmm_vec v2;
double d;

int main(){

  v1.x = 1;
  v1.y = 2;
  v2.x = 4;
  v2.y = 6;

  _sw_distance(&v1, &v2, &d);

  printf("Dist between [%lf:%lf] & [%lf:%lf]: %lf\n", 
	 v1.x, v1.y, v2.x, v2.y, d);
  
  _sw_vec_add(&v1, &v2);
  printf("Adding v1 and v2: [%lf:%lf]\n", v1.x, v1.y);

  _sw_vec_sub(&v1, &v2);
  printf("Subtracting v2: [%lf:%lf]\n", v1.x, v1.y);

  double scale = 4;
  printf("Scaling a vector: [%lf:%lf] by %lf: ", v1.x, v1.y, scale);
  _sw_vec_scale(&v1, &scale);
  printf("[%lf:%lf]\n", v1.x, v1.y);

  return 0;

}
